package cn.mw.cmdb.config.MQTT;

import com.google.common.base.Strings;

public class VersionTypeFactory {
    public static MessageArrivedHandle build(String type) {
        MessageArrivedHandle proccessor = null;
        if (Strings.isNullOrEmpty(type)) {
            return new MessageArrivedByV6800();
        } else {
            VersionTypeEnum versionType = VersionTypeEnum.valueOf(type);
            switch (versionType) {
                case V5008:
                    proccessor = new MessageArrivedByV5008();
                    break;
                case V6800:
                    proccessor = new MessageArrivedByV6800();
                    break;
            }
        }
        return proccessor;
    }

}
